<admintpl file="header" />
</head>
<body class="J_scroll_fixed">
	<div class="wrap js-check-wrap">
		<form class="well form-search" method="post" action="{:U('Tui/Agent/memChargeforgame')}">
			<div class="search_type cc mb10">
				<div class="mb10">
					<span class="mr20"> 
					订单号： 
					<input type="text" name="orderid" style="width: 150px;" value="{$formget.orderid}" placeholder="请输入订单号..."> 
					&nbsp;&nbsp; &nbsp;&nbsp; 

					游戏：
					<select class="select_2" name="gid" id="selected_id" style="width: 200px;" >
							<foreach name="games"  key="k" item="vo">
							<php>$gid_select=$k==$formget['gid'] ?"selected":"";</php>
							<option value="{$k}"{$gid_select}>{$vo}</option>
							</foreach>
					    </select>
					 &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
					 玩家账号： 
					<input type="text" name="username"
						style="width: 150px;" value="{$formget.username}"
						placeholder="请输入账号..."> 
						
					<br><br>
					 充值方式：					
					<select class="select_2" name="payway" style="width: 150px;"  id="selected_id">
						<foreach name="payways"  key="k" item="vo">
						<php>$pw_select=$k===$formget['payway'] ?"selected":"";</php>
						<option value="{$k}"{$pw_select}>{$vo}</option>
						</foreach>
					</select>
					充值状态：	
					<select class="select_2" name="paystatus" style="width: 150px;" id="selected_id">
						<foreach name="paystatuss"  key="k" item="vo">
						<php>$ps_select=$k==$formget['paystatus'] ?"selected":"";</php>
						<option value="{$k}"{$ps_select}>{$vo}</option>
						</foreach>
					</select>
					 &nbsp;&nbsp;  &nbsp;&nbsp; 
					 优惠类型：
					<select class="select_2" name="benefittype" style="width: 150px;" id="selected_id">
						<option value="0">全部</option>
						<option value="1" <if condition="$formget.benefittype eq 1"> selected </if>>折扣</option>
						<option value="2" <if condition="$formget.benefittype eq 2"> selected </if>>返利</option>
					</select>
					&nbsp;&nbsp;
					一级渠道名称 ：	
					<input type="text" name="firstagentname" style="width: 150px;" value="{$formget.firstagentname}" placeholder="请输入一级渠道名称...">
					二级渠道名称 ：	
					<input type="text" name="secagentname" style="width: 150px;" value="{$formget.secagentname}" placeholder="请输入二级渠道名称...">
					</span>
				<br><br>	
				时间：
					<input type="text" name="start_time"
						class="js-date" value="{$formget.start_time|default=''}" placeholder="开始时间..."
						style="width: 100px;" autocomplete="off">
					- 
					<input	type="text" class="js-date" name="end_time" placeholder="时间..."
						value="{$formget.end_time}" style="width: 100px;"
						autocomplete="off"> &nbsp; &nbsp; 
					</span>
			    <input type="submit"  name='submit' class="btn btn-primary" value="搜索" />
				</div>
			</div>
		</form>
		<form class="js-ajax-form" action="" method="post">
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="120">时间</th>
						<th>订单号</th>
						<th>玩家账号</th>
						<th>充值游戏</th>
						<th>充值金额</th>	
						<th>充值方式</th>	
						<th>充值状态</th>					
						<th>实付金额</th>
						<th>获得{:C('PTBNAME')}</th>
						<th>优惠类型</th>
						<th>二级渠道</th>						
						<th>一级渠道</th>
						<th>二级渠道收益</th>
						<th>一级渠道收益</th>
					</tr>
				</thead>

					<tr>
						<th style='color:#f00'>汇总</th>
						<th style='color:#f00'>--</th>
						<th style='color:#f00'>--</th>
						<th style='color:#f00'>--</th>
						<th style='color:#f00'>{$sums}</th>
						<th style='color:#f00'>{$realsum}</th>
						<th style='color:#f00'>--</th>
						<th style='color:#f00'>--</th>
						<th style='color:#f00'>--</th>
						<th style='color:#f00'>--</th>
						<th style='color:#f00'>--</th>
						<th style='color:#f00'>--</th>
                        <th style='color:#f00'>--</th>
                        <th style='color:#f00'>--</th>
					</tr>

				<foreach name="orders" item="vo">
				<tr>
				<td>{$vo.create_time|date='Y-m-d  H:i:s',###}</td>
				<td>{$vo.order_id}</td>
				<td>{$vo.username}</td>
				<td>{$vo.gamename}</td>
				<td>{$vo.amount}</td>
				<td>
					<if condition=" '0' eq $vo.payway OR '' eq $vo.payway "> 
						该订单还未支付
					<else />
						{$payways[$vo['payway']]}
					</if>
				</td>
				<td>				
				<if condition=" 2 eq $vo.status "> 
						<span style='color:#f00'>成功</span> 
				    <elseif condition=" 3 eq $vo.status" />
				    	<span style='color:#00f'>失败</span>
				    <else/>
				    	<span style='color:#000'>待支付</span>  
				</if> 
				</td>
				<td>{$vo.real_amount}</td>
				<td>{$vo.rebate_cnt}</td>
				<td>{$vo.benefittype}</td>
				<td>				
				<if condition=" 0 eq $vo['agent_id'] "> 
						<span style='color:#000'>default</span> 
				    <else />
				    	<span style='color:#000'>{$vo['agentname']}</span>  
				</if> 
				</td>
				<td>				
				<if condition=" 0 eq $vo['agent_id'] "> 
						<span style='color:#000'>default</span> 
				    <else />
				    	<span style='color:#000'>{$vo['agentname']}</span>  
				</if> 
				</td>
				<td>{$vo.agent_gain}</td>
				<td>{$vo.agent_gain}</td>			
				</tr>
				</foreach>

			</table>
			<div class="pagination">{$Page}</div>

		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>